package com.sphd.emanu.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sphd.emanu.R;
import com.sphd.emanu.pojo.material.Storage;

import java.util.List;

/**
 * @Author Hu
 * @Time 2017/6/2 --15:07.
 * @Email 87683202@qq.com
 */
public class StorageManageAdapter extends BaseQuickAdapter<Storage, BaseViewHolder> {
    boolean isCanDo;
    public StorageManageAdapter(@LayoutRes int layoutResId, @Nullable List<Storage> data, boolean isCanDo) {
        super(layoutResId, data);
        this.isCanDo=isCanDo;
    }

    @Override
    protected void convert(BaseViewHolder helper, Storage item) {
        helper
                .setText(R.id.item_storage_loc, item.getName())
                .setVisible(R.id.item_edit,isCanDo)
                .addOnClickListener(R.id.item_edit);
    }
}
